<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>兴趣交友列表 - 高级筛选</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #f0f4ff;
            --secondary: #64748b;
            --light: #f8fafc;
            --dark: #1e293b;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --border: #e2e8f0;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background-color: #f8fafc;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .navbar {
            box-shadow: var(--shadow);
            background-color: white;
        }
        
        .container {
            padding: 2rem 0;
        }
        
        .section-header {
            margin-bottom: 2rem;
        }
        
        .section-title {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.75rem;
        }
        
        .section-subtitle {
            color: var(--secondary);
            max-width: 800px;
        }
        
        /* 筛选区域样式 */
        .filter-container {
            background-color: white;
            border-radius: 0.75rem;
            box-shadow: var(--shadow);
            margin-bottom: 2rem;
            overflow: hidden;
        }
        
        .filter-header {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .filter-title {
            font-weight: 600;
            font-size: 1.1rem;
        }
        
        .filter-toggle {
            color: var(--primary);
            background: none;
            border: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            cursor: pointer;
        }
        
        .filter-content {
            padding: 1.5rem;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            border-bottom: 1px solid var(--border);
        }
        
        .filter-section {
            margin-bottom: 1rem;
        }
        
        .filter-section-title {
            font-weight: 600;
            margin-bottom: 0.75rem;
            font-size: 0.95rem;
            color: var(--dark);
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }
        
        .filter-tag {
            background-color: var(--light);
            color: var(--secondary);
            padding: 0.35rem 0.85rem;
            border-radius: 999px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid transparent;
        }
        
        .filter-tag:hover, .filter-tag.active {
            background-color: var(--primary-light);
            color: var(--primary);
            border-color: var(--primary);
        }
        
        .filter-actions {
            padding: 1rem 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .applied-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
            padding: 1rem 1.5rem;
            background-color: var(--primary-light);
            border-radius: 0.75rem;
        }
        
        .applied-filter {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background-color: white;
            padding: 0.35rem 0.85rem;
            border-radius: 999px;
            font-size: 0.85rem;
            border: 1px solid var(--primary);
            color: var(--primary);
        }
        
        .remove-filter {
            color: var(--primary);
            background: none;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            transition: background-color 0.2s;
        }
        
        .remove-filter:hover {
            background-color: var(--primary-light);
        }
        
        /* 列表布局控制 */
        .view-options {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
            justify-content: flex-end;
        }
        
        .view-btn {
            width: 36px;
            height: 36px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: var(--light);
            color: var(--secondary);
            border: none;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .view-btn.active {
            background-color: var(--primary);
            color: white;
        }
        
        /* 卡片通用样式 */
        .friend-card {
            background-color: white;
            border-radius: 1rem;
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: transform 0.3s, box-shadow 0.3s;
            margin-bottom: 1.5rem;
        }
        
        .friend-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }
        
        .card-content {
            padding: 1.25rem;
        }
        
        .interest-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            transition: color 0.2s;
        }
        
        .friend-card:hover .interest-title {
            color: var(--primary);
        }
        
        .interest-desc {
            color: var(--secondary);
            font-size: 0.9rem;
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .card-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 0.85rem;
            color: var(--secondary);
            border-top: 1px solid var(--border);
            padding-top: 1rem;
            margin-top: 0.5rem;
        }
        
        .meta-stats {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .meta-stat {
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }
        
        .card-actions {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        
        .action-btn {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            color: var(--secondary);
            background: none;
            border: none;
            font-size: 0.85rem;
            cursor: pointer;
            transition: color 0.2s;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
        }
        
        .action-btn:hover {
            color: var(--primary);
            background-color: var(--primary-light);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        .action-btn.saved {
            color: var(--primary);
        }
        
        .user-info {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .user-name {
            font-weight: 500;
            font-size: 0.95rem;
        }
        
        .user-role {
            font-size: 0.75rem;
            color: var(--secondary);
        }
        
        .card-image {
            height: 180px;
            position: relative;
            overflow: hidden;
        }
        
        .card-image.no-image {
            height: 120px;
            background-color: var(--primary-light);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 2rem;
        }
        
        .card-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s;
        }
        
        .friend-card:hover .card-image img {
            transform: scale(1.05);
        }
        
        /* 布局切换 */
        .layout-view {
            display: none;
        }
        
        .layout-view.active {
            display: block;
        }
        
        .grid-columns-2 {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1.5rem;
        }
        
        .grid-columns-3 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem;
        }
        
        .list-view {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        
        .list-view .friend-card {
            display: flex;
            height: 200px;
        }
        
        .list-view .card-image {
            flex: 0 0 200px;
            height: 100%;
        }
        
        .list-view .card-content {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        /* 响应式设计 */
        @media (max-width: 1200px) {
            .grid-columns-3 {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        
        @media (max-width: 992px) {
            .list-view .friend-card {
                flex-direction: column;
                height: auto;
            }
            
            .list-view .card-image {
                flex: none;
                width: 100%;
            }
        }
        
        @media (max-width: 768px) {
            .grid-columns-2,
            .grid-columns-3 {
                grid-template-columns: 1fr;
            }
            
            .filter-content {
                grid-template-columns: 1fr;
            }
            
            .filter-actions {
                flex-direction: column;
                gap: 1rem;
                align-items: stretch;
            }
            
            .section-title {
                font-size: 1.75rem;
            }
        }
        
        /* 范围滑块样式 */
        .range-slider {
            width: 100%;
            margin: 1rem 0;
        }
        
        .range-labels {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            color: var(--secondary);
            margin-top: 0.5rem;
        }
        
        /* 搜索框样式 */
        .search-box {
            position: relative;
            margin-bottom: 1rem;
        }
        
        .search-input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 2.5rem;
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            font-size: 0.9rem;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        .search-icon {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--secondary);
        }
        
        /* 加载更多按钮 */
        .load-more {
            text-align: center;
            margin: 2rem 0;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light">
        <div class="container">
            <a class="navbar-brand" href="#">
                <i class="fas fa-users text-primary me-2"></i>兴趣社交
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">兴趣测试</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" href="#">交友推荐</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">社区</a>
                    </li>
                </ul>
                <div class="d-flex align-items-center gap-3">
                    <button class="btn btn-outline-primary">登录</button>
                    <button class="btn btn-primary">注册</button>
                </div>
            </div>
        </div>
    </nav>
    
    <!-- 主要内容区 -->
    <div class="container">
        <div class="section-header">
            <h1 class="section-title">兴趣交友列表</h1>
            <p class="section-subtitle">通过多种筛选条件，找到与你志同道合的朋友，建立有意义的连接。</p>
        </div>
        
        <!-- 高级筛选器 -->
        <div class="filter-container">
            <div class="filter-header">
                <div class="filter-title">高级筛选</div>
                <button class="filter-toggle" id="filterToggle">
                    <i class="fas fa-chevron-up"></i>
                    <span>收起筛选</span>
                </button>
            </div>
            
            <div class="filter-content" id="filterContent">
                <!-- 搜索框 -->
                <div class="filter-section">
                    <div class="filter-section-title">关键词搜索</div>
                    <div class="search-box">
                        <i class="fas fa-search search-icon"></i>
                        <input type="text" class="search-input" placeholder="搜索兴趣、活动或用户名...">
                    </div>
                </div>
                
                <!-- 兴趣类别 -->
                <div class="filter-section">
                    <div class="filter-section-title">兴趣类别</div>
                    <div class="filter-options">
                        <div class="filter-tag" data-filter="category" data-value="all">全部</div>
                        <div class="filter-tag" data-filter="category" data-value="music">音乐</div>
                        <div class="filter-tag" data-filter="category" data-value="movie">电影</div>
                        <div class="filter-tag" data-filter="category" data-value="reading">阅读</div>
                        <div class="filter-tag" data-filter="category" data-value="sports">运动</div>
                        <div class="filter-tag" data-filter="category" data-value="food">美食</div>
                        <div class="filter-tag" data-filter="category" data-value="travel">旅行</div>
                        <div class="filter-tag" data-filter="category" data-value="photography">摄影</div>
                        <div class="filter-tag" data-filter="category" data-value="tech">科技</div>
                        <div class="filter-tag" data-filter="category" data-value="art">艺术</div>
                    </div>
                </div>
                
                <!-- 活动类型 -->
                <div class="filter-section">
                    <div class="filter-section-title">活动类型</div>
                    <div class="filter-options">
                        <div class="filter-tag" data-filter="activity" data-value="all">全部</div>
                        <div class="filter-tag" data-filter="activity" data-value="online">线上活动</div>
                        <div class="filter-tag" data-filter="activity" data-value="offline">线下活动</div>
                        <div class="filter-tag" data-filter="activity" data-value="group">小组聚会</div>
                        <div class="filter-tag" data-filter="activity" data-value="one-on-one">一对一交流</div>
                    </div>
                </div>
                
                <!-- 性别筛选 -->
                <div class="filter-section">
                    <div class="filter-section-title">性别</div>
                    <div class="filter-options">
                        <div class="filter-tag" data-filter="gender" data-value="all">不限</div>
                        <div class="filter-tag" data-filter="gender" data-value="male">男</div>
                        <div class="filter-tag" data-filter="gender" data-value="female">女</div>
                        <div class="filter-tag" data-filter="gender" data-value="other">其他</div>
                    </div>
                </div>
                
                <!-- 年龄范围 -->
                <div class="filter-section">
                    <div class="filter-section-title">年龄范围</div>
                    <input type="range" min="18" max="65" value="30" class="form-range range-slider" id="ageRange">
                    <div class="range-labels">
                        <span id="ageMin">18岁</span>
                        <span id="ageMax">65岁</span>
                    </div>
                </div>
                
                <!-- 距离范围 -->
                <div class="filter-section">
                    <div class="filter-section-title">距离范围</div>
                    <input type="range" min="1" max="50" value="10" class="form-range range-slider" id="distanceRange">
                    <div class="range-labels">
                        <span id="distanceMin">1km</span>
                        <span id="distanceMax">50km</span>
                    </div>
                </div>
                
                <!-- 活跃度 -->
                <div class="filter-section">
                    <div class="filter-section-title">活跃度</div>
                    <div class="filter-options">
                        <div class="filter-tag" data-filter="activity" data-value="all">全部</div>
                        <div class="filter-tag" data-filter="activity" data-value="very-active">非常活跃</div>
                        <div class="filter-tag" data-filter="activity" data-value="active">活跃</div>
                        <div class="filter-tag" data-filter="activity" data-value="occasionally">偶尔活跃</div>
                    </div>
                </div>
                
                <!-- 会员类型 -->
                <div class="filter-section">
                    <div class="filter-section-title">会员类型</div>
                    <div class="filter-options">
                        <div class="filter-tag" data-filter="member" data-value="all">全部</div>
                        <div class="filter-tag" data-filter="member" data-value="vip">VIP会员</div>
                        <div class="filter-tag" data-filter="member" data-value="premium">高级会员</div>
                        <div class="filter-tag" data-filter="member" data-value="standard">普通会员</div>
                    </div>
                </div>
            </div>
            
            <div class="filter-actions">
                <button class="btn btn-outline-secondary" id="resetFilters">
                    <i class="fas fa-sync-alt me-1"></i> 重置筛选条件
                </button>
                <button class="btn btn-primary" id="applyFilters">
                    <i class="fas fa-filter me-1"></i> 应用筛选条件
                </button>
            </div>
        </div>
        
        <!-- 已应用的筛选条件 -->
        <div class="applied-filters" id="appliedFilters">
            <!-- 这里会通过JavaScript动态添加已选择的筛选条件 -->
            <div class="applied-filter">
                <span>全部兴趣</span>
                <button class="remove-filter" data-filter="category" data-value="all">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="applied-filter">
                <span>年龄: 18-65岁</span>
                <button class="remove-filter" data-filter="age">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="applied-filter">
                <span>距离: 1-50km</span>
                <button class="remove-filter" data-filter="distance">
                    <i class="fas fa-times"></i>
                </button>
            </div>
        </div>
        
        <!-- 视图切换和排序 -->
        <div class="d-flex justify-content-between align-items-center mb-3">
            <div class="filter-group">
                <span class="filter-label me-2">排序方式：</span>
                <div class="filter-options">
                    <div class="filter-tag active" data-sort="recommended">推荐</div>
                    <div class="filter-tag" data-sort="newest">最新</div>
                    <div class="filter-tag" data-sort="popular">最热</div>
                    <div class="filter-tag" data-sort="distance">距离最近</div>
                </div>
            </div>
            
            <div class="view-options">
                <span class="filter-label me-2">视图：</span>
                <button class="view-btn active" data-view="grid-3" title="网格布局(3列)">
                    <i class="fas fa-th-large"></i>
                </button>
                <button class="view-btn" data-view="grid-2" title="网格布局(2列)">
                    <i class="fas fa-th"></i>
                </button>
                <button class="view-btn" data-view="list" title="列表布局">
                    <i class="fas fa-list"></i>
                </button>
            </div>
        </div>
        
        <!-- 交友列表 -->
        <div class="layout-view active" id="grid-3">
            <div class="grid-columns-3">
                <!-- 交友卡片1 -->
                <div class="friend-card" data-category="photography" data-activity="offline" data-gender="male" data-age="28" data-distance="5">
                    <div class="card-image">
                        <img src="https://picsum.photos/600/400?random=1" alt="户外摄影爱好者聚会">
                    </div>
                    <div class="card-content">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=101" alt="李明的头像" class="user-avatar">
                            <div>
                                <div class="user-name">李明, 28岁</div>
                                <div class="user-role">户外摄影爱好者</div>
                            </div>
                        </div>
                        <h3 class="interest-title">周末户外摄影小组招募新成员</h3>
                        <p class="interest-desc">我们是一群热爱自然和摄影的朋友，每周末组织户外拍摄活动，欢迎摄影爱好者加入我们，一起交流技巧，捕捉美好瞬间。</p>
                        <div class="card-meta">
                            <div class="meta-stats">
                                <div class="meta-stat">
                                    <i class="fas fa-eye"></i>
                                    <span>1.2k</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-comment"></i>
                                    <span>86</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-map-marker-alt"></i>
                                    <span>5km</span>
                                </div>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn liked">
                                    <i class="fas fa-heart"></i>
                                    <span>128</span>
                                </button>
                                <button class="action-btn">
                                    <i class="far fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 交友卡片2 -->
                <div class="friend-card" data-category="music" data-activity="online" data-gender="female" data-age="25" data-distance="12">
                    <div class="card-image no-image">
                        <i class="fas fa-music"></i>
                    </div>
                    <div class="card-content">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=102" alt="王芳的头像" class="user-avatar">
                            <div>
                                <div class="user-name">王芳, 25岁</div>
                                <div class="user-role">独立音乐制作人</div>
                            </div>
                        </div>
                        <h3 class="interest-title">寻找电子音乐创作伙伴</h3>
                        <p class="interest-desc">正在创作一张电子音乐EP，寻找有共同音乐品味的伙伴一起合作，需要擅长旋律创作或编曲的朋友，有兴趣请联系我。</p>
                        <div class="card-meta">
                            <div class="meta-stats">
                                <div class="meta-stat">
                                    <i class="fas fa-eye"></i>
                                    <span>856</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-comment"></i>
                                    <span>42</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-map-marker-alt"></i>
                                    <span>12km</span>
                                </div>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn">
                                    <i class="far fa-heart"></i>
                                    <span>64</span>
                                </button>
                                <button class="action-btn saved">
                                    <i class="fas fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 交友卡片3 -->
                <div class="friend-card" data-category="reading" data-activity="group" data-gender="male" data-age="32" data-distance="8">
                    <div class="card-image">
                        <img src="https://picsum.photos/600/400?random=3" alt="读书会活动照片">
                    </div>
                    <div class="card-content">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=103" alt="张伟的头像" class="user-avatar">
                            <div>
                                <div class="user-name">张伟, 32岁</div>
                                <div class="user-role">文学爱好者</div>
                            </div>
                        </div>
                        <h3 class="interest-title">每月读书会 - 本月主题：科幻文学</h3>
                        <p class="interest-desc">每月一次的线下读书会，本月我们将讨论科幻文学的发展与影响，欢迎科幻爱好者参与，一起分享你喜欢的作品和观点。</p>
                        <div class="card-meta">
                            <div class="meta-stats">
                                <div class="meta-stat">
                                    <i class="fas fa-eye"></i>
                                    <span>932</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-comment"></i>
                                    <span>57</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-map-marker-alt"></i>
                                    <span>8km</span>
                                </div>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn">
                                    <i class="far fa-heart"></i>
                                    <span>78</span>
                                </button>
                                <button class="action-btn">
                                    <i class="far fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 交友卡片4 -->
                <div class="friend-card" data-category="food" data-activity="group" data-gender="female" data-age="27" data-distance="3">
                    <div class="card-image no-image">
                        <i class="fas fa-utensils"></i>
                    </div>
                    <div class="card-content">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=104" alt="刘婷的头像" class="user-avatar">
                            <div>
                                <div class="user-name">刘婷, 27岁</div>
                                <div class="user-role">美食博主</div>
                            </div>
                        </div>
                        <h3 class="interest-title">寻找美食探店搭档</h3>
                        <p class="interest-desc">喜欢探索城市里的隐藏美食，寻找同样热爱美食的朋友一起探店，分享美食体验，要求有良好的口味和乐于尝试的精神。</p>
                        <div class="card-meta">
                            <div class="meta-stats">
                                <div class="meta-stat">
                                    <i class="fas fa-eye"></i>
                                    <span>1.5k</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-comment"></i>
                                    <span>103</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-map-marker-alt"></i>
                                    <span>3km</span>
                                </div>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn liked">
                                    <i class="fas fa-heart"></i>
                                    <span>215</span>
                                </button>
                                <button class="action-btn">
                                    <i class="far fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 交友卡片5 -->
                <div class="friend-card" data-category="sports" data-activity="group" data-gender="male" data-age="30" data-distance="6">
                    <div class="card-image">
                        <img src="https://picsum.photos/600/400?random=5" alt="马拉松训练照片">
                    </div>
                    <div class="card-content">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=105" alt="赵强的头像" class="user-avatar">
                            <div>
                                <div class="user-name">赵强, 30岁</div>
                                <div class="user-role">马拉松爱好者</div>
                            </div>
                        </div>
                        <h3 class="interest-title">城市晨跑小组，每天5点集合</h3>
                        <p class="interest-desc">我们是一群坚持晨跑的爱好者，每天清晨5点在市中心广场集合，一起跑步锻炼，无论你是新手还是老手，都欢迎加入我们的队伍。</p>
                        <div class="card-meta">
                            <div class="meta-stats">
                                <div class="meta-stat">
                                    <i class="fas fa-eye"></i>
                                    <span>765</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-comment"></i>
                                    <span>38</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-map-marker-alt"></i>
                                    <span>6km</span>
                                </div>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn">
                                    <i class="far fa-heart"></i>
                                    <span>52</span>
                                </button>
                                <button class="action-btn saved">
                                    <i class="fas fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 交友卡片6 -->
                <div class="friend-card" data-category="movie" data-activity="group" data-gender="female" data-age="29" data-distance="9">
                    <div class="card-image">
                        <img src="https://picsum.photos/600/400?random=6" alt="电影放映活动">
                    </div>
                    <div class="card-content">
                        <div class="user-info">
                            <img src="https://picsum.photos/100/100?random=106" alt="陈雪的头像" class="user-avatar">
                            <div>
                                <div class="user-name">陈雪, 29岁</div>
                                <div class="user-role">独立电影策展人</div>
                            </div>
                        </div>
                        <h3 class="interest-title">独立电影放映会，每周六晚7点</h3>
                        <p class="interest-desc">定期举办独立电影放映会，专注于展示国内外优秀的独立电影作品，放映后有导演交流环节，欢迎电影爱好者参与讨论。</p>
                        <div class="card-meta">
                            <div class="meta-stats">
                                <div class="meta-stat">
                                    <i class="fas fa-eye"></i>
                                    <span>1.1k</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-comment"></i>
                                    <span>74</span>
                                </div>
                                <div class="meta-stat">
                                    <i class="fas fa-map-marker-alt"></i>
                                    <span>9km</span>
                                </div>
                            </div>
                            <div class="card-actions">
                                <button class="action-btn liked">
                                    <i class="fas fa-heart"></i>
                                    <span>156</span>
                                </button>
                                <button class="action-btn">
                                    <i class="far fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 2列网格布局 -->
        <div class="layout-view" id="grid-2">
            <div class="grid-columns-2">
                <!-- 内容与3列网格相同，通过CSS控制布局 -->
            </div>
        </div>
        
        <!-- 列表布局 -->
        <div class="layout-view" id="list">
            <div class="list-view">
                <!-- 内容与网格布局相同，通过CSS控制布局 -->
            </div>
        </div>
        
        <!-- 加载更多 -->
        <div class="load-more">
            <button class="btn btn-outline-primary btn-lg">
                <i class="fas fa-sync-alt me-2"></i>加载更多
            </button>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 复制卡片到其他布局视图
            const grid3Cards = document.querySelectorAll('#grid-3 .friend-card');
            const grid2Container = document.querySelector('#grid-2 .grid-columns-2');
            const listContainer = document.querySelector('#list .list-view');
            
            grid3Cards.forEach(card => {
                grid2Container.appendChild(card.cloneNode(true));
                listContainer.appendChild(card.cloneNode(true));
            });
            
            // 筛选器折叠/展开功能
            const filterToggle = document.getElementById('filterToggle');
            const filterContent = document.getElementById('filterContent');
            let filterExpanded = true;
            
            filterToggle.addEventListener('click', function() {
                filterExpanded = !filterExpanded;
                if (filterExpanded) {
                    filterContent.style.display = 'grid';
                    filterToggle.innerHTML = '<i class="fas fa-chevron-up"></i><span>收起筛选</span>';
                } else {
                    filterContent.style.display = 'none';
                    filterToggle.innerHTML = '<i class="fas fa-chevron-down"></i><span>展开筛选</span>';
                }
            });
            
            // 范围滑块功能
            const ageRange = document.getElementById('ageRange');
            const ageMin = document.getElementById('ageMin');
            const ageMax = document.getElementById('ageMax');
            
            ageRange.addEventListener('input', function() {
                ageMin.textContent = `${this.value}岁`;
            });
            
            const distanceRange = document.getElementById('distanceRange');
            const distanceMin = document.getElementById('distanceMin');
            const distanceMax = document.getElementById('distanceMax');
            
            distanceRange.addEventListener('input', function() {
                distanceMin.textContent = `${this.value}km`;
            });
            
            // 筛选标签选择功能
            const filterTags = document.querySelectorAll('.filter-tag');
            
            filterTags.forEach(tag => {
                tag.addEventListener('click', function() {
                    // 对于同一类别的筛选，只允许选择一个
                    const filterType = this.getAttribute('data-filter');
                    if (filterType) {
                        document.querySelectorAll(`.filter-tag[data-filter="${filterType}"]`)
                            .forEach(t => t.classList.remove('active'));
                    }
                    
                    this.classList.add('active');
                });
            });
            
            // 视图切换功能
            const viewButtons = document.querySelectorAll('.view-btn');
            const layoutViews = document.querySelectorAll('.layout-view');
            
            viewButtons.forEach(button => {
                button.addEventListener('click', function() {
                    // 移除所有按钮的active类
                    viewButtons.forEach(btn => btn.classList.remove('active'));
                    // 给当前点击的按钮添加active类
                    this.classList.add('active');
                    
                    // 获取要显示的布局
                    const viewToShow = this.getAttribute('data-view');
                    
                    // 隐藏所有布局
                    layoutViews.forEach(view => view.classList.remove('active'));
                    
                    // 显示选中的布局
                    document.getElementById(viewToShow).classList.add('active');
                });
            });
            
            // 排序功能
            const sortTags = document.querySelectorAll('[data-sort]');
            
            sortTags.forEach(tag => {
                tag.addEventListener('click', function() {
                    // 移除所有排序标签的active类
                    sortTags.forEach(t => t.classList.remove('active'));
                    // 给当前点击的标签添加active类
                    this.classList.add('active');
                    
                    const sortType = this.getAttribute('data-sort');
                    // 这里可以添加实际的排序逻辑
                    console.log(`排序方式: ${sortType}`);
                    
                    // 模拟排序效果
                    applyFilters();
                });
            });
            
            // 应用筛选条件
            const applyFiltersBtn = document.getElementById('applyFilters');
            applyFiltersBtn.addEventListener('click', applyFilters);
            
            function applyFilters() {
                // 获取所有选中的筛选条件
                const activeFilters = {};
                
                document.querySelectorAll('.filter-tag.active[data-filter]').forEach(tag => {
                    const filterType = tag.getAttribute('data-filter');
                    const filterValue = tag.getAttribute('data-value');
                    activeFilters[filterType] = filterValue;
                });
                
                // 添加范围筛选条件
                activeFilters.age = {
                    min: parseInt(ageRange.min),
                    max: parseInt(ageRange.value)
                };
                
                activeFilters.distance = {
                    min: parseInt(distanceRange.min),
                    max: parseInt(distanceRange.value)
                };
                
                console.log('应用筛选条件:', activeFilters);
                
                // 更新已应用筛选条件显示
                updateAppliedFilters(activeFilters);
                
                // 筛选卡片
                filterCards(activeFilters);
            }
            
            // 更新已应用筛选条件显示
            function updateAppliedFilters(filters) {
                const appliedFiltersContainer = document.getElementById('appliedFilters');
                appliedFiltersContainer.innerHTML = '';
                
                // 添加兴趣类别筛选
                if (filters.category) {
                    const categoryMap = {
                        'all': '全部兴趣',
                        'music': '音乐',
                        'movie': '电影',
                        'reading': '阅读',
                        'sports': '运动',
                        'food': '美食',
                        'travel': '旅行',
                        'photography': '摄影',
                        'tech': '科技',
                        'art': '艺术'
                    };
                    
                    const filterEl = document.createElement('div');
                    filterEl.className = 'applied-filter';
                    filterEl.innerHTML = `
                        <span>${categoryMap[filters.category]}</span>
                        <button class="remove-filter" data-filter="category" data-value="${filters.category}">
                            <i class="fas fa-times"></i>
                        </button>
                    `;
                    appliedFiltersContainer.appendChild(filterEl);
                }
                
                // 添加活动类型筛选
                if (filters.activity && filters.activity !== 'all') {
                    const activityMap = {
                        'online': '线上活动',
                        'offline': '线下活动',
                        'group': '小组聚会',
                        'one-on-one': '一对一交流',
                        'very-active': '非常活跃',
                        'active': '活跃',
                        'occasionally': '偶尔活跃'
                    };
                    
                    const filterEl = document.createElement('div');
                    filterEl.className = 'applied-filter';
                    filterEl.innerHTML = `
                        <span>${activityMap[filters.activity]}</span>
                        <button class="remove-filter" data-filter="activity" data-value="${filters.activity}">
                            <i class="fas fa-times"></i>
                        </button>
                    `;
                    appliedFiltersContainer.appendChild(filterEl);
                }
                
                // 添加性别筛选
                if (filters.gender && filters.gender !== 'all') {
                    const genderMap = {
                        'male': '男性',
                        'female': '女性',
                        'other': '其他'
                    };
                    
                    const filterEl = document.createElement('div');
                    filterEl.className = 'applied-filter';
                    filterEl.innerHTML = `
                        <span>${genderMap[filters.gender]}</span>
                        <button class="remove-filter" data-filter="gender" data-value="${filters.gender}">
                            <i class="fas fa-times"></i>
                        </button>
                    `;
                    appliedFiltersContainer.appendChild(filterEl);
                }
                
                // 添加会员类型筛选
                if (filters.member && filters.member !== 'all') {
                    const memberMap = {
                        'vip': 'VIP会员',
                        'premium': '高级会员',
                        'standard': '普通会员'
                    };
                    
                    const filterEl = document.createElement('div');
                    filterEl.className = 'applied-filter';
                    filterEl.innerHTML = `
                        <span>${memberMap[filters.member]}</span>
                        <button class="remove-filter" data-filter="member" data-value="${filters.member}">
                            <i class="fas fa-times"></i>
                        </button>
                    `;
                    appliedFiltersContainer.appendChild(filterEl);
                }
                
                // 添加年龄范围筛选
                const ageFilterEl = document.createElement('div');
                ageFilterEl.className = 'applied-filter';
                ageFilterEl.innerHTML = `
                    <span>年龄: ${filters.age.min}-${filters.age.max}岁</span>
                    <button class="remove-filter" data-filter="age">
                        <i class="fas fa-times"></i>
                    </button>
                `;
                appliedFiltersContainer.appendChild(ageFilterEl);
                
                // 添加距离范围筛选
                const distanceFilterEl = document.createElement('div');
                distanceFilterEl.className = 'applied-filter';
                distanceFilterEl.innerHTML = `
                    <span>距离: ${filters.distance.min}-${filters.distance.max}km</span>
                    <button class="remove-filter" data-filter="distance">
                        <i class="fas fa-times"></i>
                    </button>
                `;
                appliedFiltersContainer.appendChild(distanceFilterEl);
                
                // 为移除筛选按钮添加事件监听
                document.querySelectorAll('.remove-filter').forEach(btn => {
                    btn.addEventListener('click', function() {
                        const filterType = this.getAttribute('data-filter');
                        const filterValue = this.getAttribute('data-value');
                        
                        // 移除对应的筛选条件
                        if (filterType === 'age') {
                            ageRange.value = ageRange.max;
                            ageMin.textContent = `${ageRange.min}岁`;
                        } else if (filterType === 'distance') {
                            distanceRange.value = distanceRange.max;
                            distanceMin.textContent = `${distanceRange.min}km`;
                        } else if (filterValue) {
                            // 取消对应标签的选中状态
                            document.querySelector(`.filter-tag[data-filter="${filterType}"][data-value="${filterValue}"]`)
                                ?.classList.remove('active');
                            
                            // 选中"全部"标签
                            document.querySelector(`.filter-tag[data-filter="${filterType}"][data-value="all"]`)
                                ?.classList.add('active');
                        }
                        
                        // 重新应用筛选
                        applyFilters();
                    });
                });
            }
            
            // 根据筛选条件过滤卡片
            function filterCards(filters) {
                const allCards = document.querySelectorAll('.friend-card');
                
                allCards.forEach(card => {
                    let showCard = true;
                    
                    // 检查兴趣类别筛选
                    if (filters.category && filters.category !== 'all') {
                        if (card.getAttribute('data-category') !== filters.category) {
                            showCard = false;
                        }
                    }
                    
                    // 检查活动类型筛选
                    if (showCard && filters.activity && filters.activity !== 'all') {
                        if (card.getAttribute('data-activity') !== filters.activity) {
                            showCard = false;
                        }
                    }
                    
                    // 检查性别筛选
                    if (showCard && filters.gender && filters.gender !== 'all') {
                        if (card.getAttribute('data-gender') !== filters.gender) {
                            showCard = false;
                        }
                    }
                    
                    // 检查年龄范围筛选
                    if (showCard && filters.age) {
                        const cardAge = parseInt(card.getAttribute('data-age'));
                        if (cardAge < filters.age.min || cardAge > filters.age.max) {
                            showCard = false;
                        }
                    }
                    
                    // 检查距离范围筛选
                    if (showCard && filters.distance) {
                        const cardDistance = parseInt(card.getAttribute('data-distance'));
                        if (cardDistance < filters.distance.min || cardDistance > filters.distance.max) {
                            showCard = false;
                        }
                    }
                    
                    // 显示或隐藏卡片
                    card.style.display = showCard ? 'block' : 'none';
                });
            }
            
            // 重置筛选条件
            const resetFiltersBtn = document.getElementById('resetFilters');
            resetFiltersBtn.addEventListener('click', function() {
                // 重置所有筛选标签
                document.querySelectorAll('.filter-tag.active').forEach(tag => {
                    tag.classList.remove('active');
                });
                
                // 选中所有"全部"标签
                document.querySelectorAll('.filter-tag[data-value="all"]').forEach(tag => {
                    tag.classList.add('active');
                });
                
                // 重置范围滑块
                ageRange.value = ageRange.max;
                ageMin.textContent = `${ageRange.min}岁`;
                
                distanceRange.value = distanceRange.max;
                distanceMin.textContent = `${distanceRange.min}km`;
                
                // 重置搜索框
                document.querySelector('.search-input').value = '';
                
                // 应用重置后的筛选条件
                applyFilters();
            });
            
            // 点赞功能
            document.addEventListener('click', function(e) {
                if (e.target.closest('.action-btn') && e.target.closest('.action-btn').querySelector('.fa-heart')) {
                    const button = e.target.closest('.action-btn');
                    const icon = button.querySelector('i');
                    const countElement = button.querySelector('span');
                    
                    if (button.classList.contains('liked')) {
                        // 取消点赞
                        button.classList.remove('liked');
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        
                        // 更新点赞数
                        if (countElement) {
                            let count = parseInt(countElement.textContent);
                            countElement.textContent = count - 1;
                        }
                    } else {
                        // 点赞
                        button.classList.add('liked');
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        
                        // 更新点赞数
                        if (countElement) {
                            let count = parseInt(countElement.textContent);
                            countElement.textContent = count + 1;
                        }
                    }
                }
            });
            
            // 收藏功能
            document.addEventListener('click', function(e) {
                if (e.target.closest('.action-btn') && e.target.closest('.action-btn').querySelector('.fa-bookmark')) {
                    const button = e.target.closest('.action-btn');
                    const icon = button.querySelector('i');
                    
                    if (button.classList.contains('saved')) {
                        // 取消收藏
                        button.classList.remove('saved');
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                    } else {
                        // 收藏
                        button.classList.add('saved');
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                    }
                }
            });
            
            // 加载更多功能
            document.querySelector('.load-more .btn').addEventListener('click', function() {
                this.innerHTML = '<i class="fas fa-spinner fa-spin me-2"></i>加载中...';
                
                // 模拟加载延迟
                setTimeout(() => {
                    this.innerHTML = '<i class="fas fa-sync-alt me-2"></i>加载更多';
                    // 这里可以添加实际加载更多内容的逻辑
                }, 1500);
            });
            
            // 初始化筛选条件
            applyFilters();
        });
    </script>
</body>
</html>
    
